|
Welcome
to echo $hotelname3 ?> Guestbook |
$query5 = "select * from _guestbook_posts where hotelname = '$hotelname' and location = '$location'";
$result5 = mysql_query($query5);
while($row15 = mysql_fetch_assoc($result5))
{
$hotel_id = $row15['hotel_id'];
}
?>
Add your post
////////////////starting code fro pagination
$showpages = "Y";
/////setting limit to 5 records per page
$limit=5;
if (empty($offset))
{
$offset=0;
}
/////////////checking if any posts are available
$query = "select * from _guestbook_posts where hotelname = '$hotelname' and location = '$location' and flag2 = '1'";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
if ($numrows==0) {
echo '
We are sorry, there are not any available posts to display!
';
}
else {
//////////////////retrieving posts with specific criteria from the database
$query3 = "select * from _guestbook_posts where hotelname = '$hotelname' and location = '$location' and flag2 = '1' order by ID desc limit $offset,$limit";
$result3 = mysql_query($query3);
while ($row2=mysql_fetch_assoc($result3))
{
$ID = $row2['ID'];
$name = $row2['name'];
$title = $row2['title'];
$email = $row2['email'];
$email2 = $row2['email2'];
$post = $row2['post'];
$post2 = str_replace("\n", "
", $post);
$date = $row2['date'];
?>